<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>邮箱首页</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="styles/index.css">
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript"
		src="tools/pushlet/ajax-pushlet-client.js">
</script>
	<script type="text/javascript" src="tools/pushlet/util.js">
</script>
		<script type="text/javascript">
			$(document).ready(function(){
				function enter(){
					p_join_listen("newMail");
				}	
				function onData(event) {
				  	p_debug(false, "pushlet-app", 'event received event=' + event.getEvent() );
					alert("new mail came");
				}
				enter();
				$("#inboxbtn").click(function(){
					$("#notread").remove();
				});
			});
		</script>
	</head>
	<body>
		<table id="main">
			<tr>
				<td id="main_header" colspan="2">
					<table id="header">
						<tr>
							<td id="header_logo">
								<img id="logo" src="images/logo.png"></img>
							</td>
							<td id="header_title">
								邮件系统
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td id="main_banner" colspan="2">
					您好，<s:property value="userNick"/>。
					现在是&nbsp;<s:property value="now"/>
					<a href="Logout.action">退出</a>
				</td>
			</tr>
			<tr>
				<td id="main_menu">
					<table id="menu">
						<tr>
							<td class="menuitemlogo"><img src="images/write.png"></img>
							</td>
							<td class="menuitem"><a href="Write.action" target="sub_page">写邮件</a></td>
						</tr>
						<tr>
							<td class="menuitemlogo"><img src="images/inbox.png"></img>
							</td>
							<td class="menuitem"><a id="inboxbtn" href="InboxPage.action" target="sub_page">收件箱<span id="notread">(<s:property value="notReadCount"/>)</span></a></td>
						</tr>
						<tr>
							<td class="menuitemlogo"><img src="images/outbox.png"></img>
							</td>
							<td class="menuitem"><a href="OutboxPage.action" target="sub_page">发件箱</a></td>
						</tr>
						<tr>
							<td class="menuitemlogo"><img src="images/bin.png"></img>
							</td>							
							<td class="menuitem"><a href="RecyclebinPage.action" target="sub_page">已删除</a></td>
						</tr>						
					</table>
				</td>
				<td id="main_frame">
					<iframe id="sub_page" name="sub_page"></iframe>
				</td>
			</tr>
			<tr>
				<td id="main_footer" colspan="2">
					All rights reserved @BUPT
				</td>
			</tr>
		</table>
	</body>
</html>
